import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);


const async = (page) => {
  return (resolve) => require([`@/pages/${page}`], resolve)
}

const router = new Router({
  routes: [
    {
      path: '/',
      component: async ('framework'),
      children: [{
        path: '/',
        component: async ('index'),
      },{
        path: "/shop/:id",
        component: async('shop')
      }
    ]
    },
  ]
});

//
router.beforeEach((to, from, next) => {
  next();
});

export default router;